﻿@inherits BDialogBase
<BForm @ref="form" Value="Product">
    <BGroupBox>
        <BFormItem TValue="string" Name="@nameof(UpdateProductModel.Name)" Label="名称" IsRequired="true">
            <BInput TValue="string"></BInput>
        </BFormItem>
        <BFormItem TValue="string" Name="@nameof(UpdateProductModel.Author)" Label="作者" IsRequired="true">
            <AuthorSelector></AuthorSelector>
        </BFormItem>
    </BGroupBox>
    <BGroupBox>
        <BFormItem TValue="KeyValuePair<int,string>" Name="@nameof(UpdateProductModel.Size)" Label="尺寸" IsRequired="true">
            <SizeSelector></SizeSelector>
        </BFormItem>
        <BFormItem TValue="string" Name="@nameof(UpdateProductModel.DescriptionTitle)" Label="描述标题" IsRequired="true">
            <BInput TValue="string"></BInput>
        </BFormItem>
    </BGroupBox>
    <BGroupBox>
        <BFormItem TValue="KeyValuePair<int,string>" Name=@nameof(UpdateProductModel.Company) Label="委托单位" IsRequired="true">
            <CompanySelector></CompanySelector>
        </BFormItem>
        <BFormItem TValue="KeyValuePair<int,string>" Name=@nameof(UpdateProductModel.Category) Label="分类" IsRequired="true">
            <CategorySelector></CategorySelector>
        </BFormItem>
    </BGroupBox>
    <BFormItem TValue="DateTime?" Name=@nameof(UpdateProductModel.CreationTime) Label="创作时间" IsRequired="true">
        <BDatePicker></BDatePicker>
    </BFormItem>
    <BFormItem TValue="IFileModel[]" Name=@nameof(UpdateProductModel.Image) Label="图片" IsRequired="true">
        <BUpload UploadType="UploadType.Image" Url="/api/upload"></BUpload>
    </BFormItem>
    <BFormItem TValue="string" Name=@nameof(UpdateProductModel.Description) Label="描述">
        <BInput TValue="string" @ref="editor" Style="width:820px;height:300px;" Type="InputType.Textarea" Cls="description"></BInput>
    </BFormItem>
    <BFormActionItem Style="text-align:right">
        <BButton Type="ButtonType.Primary" Text="保存" OnClick="SaveDataAsync"></BButton>
    </BFormActionItem>
</BForm>